package net.wangliping.android.tools.util;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class Convert {

	public static String stream2string(InputStream in) throws IOException {
		String content = "";
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		byte[] buf = new byte[1024];
		int len = 0;
		while ((len = in.read(buf)) > 0) {
			baos.write(buf, 0, len);
		}
		content = baos.toString();
		return content;
	}
}
